﻿using PhotoRepository;
using PhotoRepository.Models;
using System.Collections.Generic;
using System.Web.Http;

namespace PhotographyWebsite.Controllers.Api
{
    [RoutePrefix("api/Photos")]
    public class PhotosController : ApiController
    {
        private readonly IPhotoRepository photoRepository;
        public PhotosController(IPhotoRepository photoRepository)
        {
            this.photoRepository = photoRepository;
        }

        [HttpGet]
        [Route("GetAlbums")]
        public IEnumerable<Album> GetAlbums()
        {
            return photoRepository.GetAlbums();
        }

        [HttpGet]
        [Route("GetPhotosInAlbum")]
        public IEnumerable<Photo> GetPhotosInAlbum(string albumId)
        {
            return photoRepository.GetPhotoUrlsForAlbum(albumId);
        }
    }
}